Software Development
Unit Testing in JavaScript
Final Exam: Apprentice Programmer
Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework
Unit Testing in JavaScript: Mocha & Chai
Unit Testing in JavaScript: Mocha & Unit.js
Unit Testing in JavaScript: Should.js & Must.js
Unit Testing in JavaScript: SinonJS

Final Exam: Apprentice Programmer

Course Number:
it_fewpap_04_enus
Lesson Objectives

Final Exam: Apprentice Programmer

  • articulate features of the Adapter pattern
  • compare and contrast the should and expect APIs in Chai
  • compare numeric values in tests
  • compare numeric values using Assert
  • configure different reporters in Mocha
  • configure fakes with specific behavior
  • create an object to be used in test cases
  • create stubs for object methods
  • define design patterns
  • define helper functions for the factory pattern
  • describe features of the Prototype pattern
  • describe how different data types can be tested using Should.js
  • describe how event handling works on the browser
  • describe the characteristics of the Command pattern
  • describe the characteristics of the Iterator pattern
  • describe the characteristics of the State pattern
  • describe the Façade pattern
  • describe the Factory and abstract factory patterns
  • describe the key features of the constructor pattern
  • describe the Mixin pattern
  • describe the Module and Revealing Module patterns
  • describe the principles of good design
  • describe the Proxy pattern
  • describe the use of sandboxes for testing
  • determine whether objects are instances of other objects
  • identify principles of good design
  • illustrate inefficient memory usage for granular objects
  • implement private functions with the Module pattern
  • implement private variables with the Module pattern
  • implement publishers and subscribers
  • implement the Builder pattern
  • implement the Iterator mixin
  • implement the Prototype pattern
  • install and configure the Mocha testing environment
  • install Mocha and Sinon on your local machine
  • install the Chai library on your local machine
  • install the Unit.js assertion library
  • perform asynchronous tests using fakes with promises
  • perform pattern matching and substring checks using Should.js
  • prepare Mocha tests to run within a browser
  • recall characteristics of the Builder pattern
  • recall the basic principles of the Singleton pattern
  • recall the characteristics of the Composite pattern
  • recall the characteristics of the Flyweight pattern
  • recall the characteristics of the Mediator pattern
  • recall the different styles that can be used with the Should.js API
  • recall the key characteristics of the Observer pattern
  • recall the principles of the Decorator pattern
  • recognize the use of the beforeEach() and afterEach() hooks in tests
  • run basic assertions using Must.js
  • run Mocha tests in a browser
  • set up helpers for the Decorator pattern
  • set up the Mediator as a workflow object
  • use assertions to test boolean values
  • use fakes to record function invocations
  • use Mixins in the Underscore.js library
  • use Object.create() and new Object() to create objects
  • use sandboxes to simplify testing
  • use the literal object notation to construct objects
  • work with arrays and array elements

Overview/Description

Final Exam: Apprentice Programmer will test your knowledge and application of the topics presented throughout the Apprentice Programmer track of the Skillsoft Aspire Web Programmer to Apprentice Programmer Journey.



Target

Prerequisites: none

Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework

Course Number:
it_aputjsdj_03_enus
Lesson Objectives

Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework

  • discover the key concepts covered in this course
  • recognize the use of the before() and after() hooks in tests
  • recognize the use of the beforeEach() and afterEach() hooks in tests
  • implement tests using multiple hooks
  • recall why the use of the arrow functions should be avoided in Mocha
  • use the done() method to signal test completion
  • set up asynchronous test functions
  • perform asynchronous testing using async/await
  • prepare Mocha tests to run within a browser
  • run Mocha tests in a browser
  • configure different reporters in Mocha
  • run multiple tests from the command line
  • summarize the key concepts covered in this course

Overview/Description

This course explores the different features available in Mocha such as before and after hooks, asynchronous operations using promises and async/await, configuring different Mocha reporters, and running Mocha on the browser.



Target

Prerequisites: none

Unit Testing in JavaScript: Mocha & Chai

Course Number:
it_aputjsdj_04_enus
Lesson Objectives

Unit Testing in JavaScript: Mocha & Chai

  • discover the key concepts covered in this course
  • install the Chai library on your local machine
  • use assertions to test boolean values
  • compare numeric values using assert
  • performing string comparisons using assert
  • describe the assertions that can be used to test objects and their properties
  • use arrays and elements in arrays using assert
  • compare and contrast the should and expect APIs in Chai
  • test different data types using should
  • test different data types using expect
  • perform asynchronous function testing using expect
  • summarize the key concepts covered in this course

Overview/Description

This course gets you started with the Chai assertion framework and the assert, should, and expect APIs in Chai for test-driven development and behavior-driven development. You will use the classic assertion API as well as the Should and Expect API in Chai to test numbers, booleans, strings, objects and object properties, and arrays in Chai.



Target

Prerequisites: none

Unit Testing in JavaScript: Mocha & Unit.js

Course Number:
it_aputjsdj_01_enus
Lesson Objectives

Unit Testing in JavaScript: Mocha & Unit.js

  • discover the key concepts covered in this course
  • install and configure the Mocha testing environment
  • install the Unit.js assertion library
  • use assertions to test boolean values
  • use assertions to test strings
  • match strings using regular expressions and custom functions
  • compare numeric values in tests
  • use assertions to test function objects
  • work with arrays and array elements
  • compare objects using equality operations
  • test objects using match
  • determine whether objects are instances of other objects
  • summarize the different ways to test errors
  • describe how values of different data types can be tested
  • summarize the key concepts covered in this course

Overview/Description

This course uses the Mocha testing framework and the Unit.js assertion library to unit test your JavaScript code. You will write unit tests to test numeric values, strings, objects, arrays, functions and exceptions using Unit.js.



Target

Prerequisites: none

Unit Testing in JavaScript: Should.js & Must.js

Course Number:
it_aputjsdj_02_enus
Lesson Objectives

Unit Testing in JavaScript: Should.js & Must.js

  • discover the key concepts covered in this course
  • recall the different styles that can be used with the Should.js API
  • describe how different data types can be tested using Should.js
  • execute assertions to check for values that evaluate to true and false using Should.js
  • perform pattern matching and substring checks using Should.js
  • evaluate numeric values using Should.js
  • examine objects and properties using Should.js
  • evaluate functions that return promises
  • recall the different styles that can be used with the Must.js API
  • run basic assertions using Must.js
  • use assertions to test different data types with Must.js
  • summarize the key concepts covered in this course

Overview/Description

This course shows you how you can use the Mocha testing framework along with Should.js and Must.js assertion libraries to test code using a chained assertion style. You will write unit tests to test numbers, strings, truthy and falsy values, objects, arrays and promises in JavaScript.



Target

Prerequisites: none

Unit Testing in JavaScript: SinonJS

Course Number:
it_aputjsdj_05_enus
Lesson Objectives

Unit Testing in JavaScript: SinonJS

  • discover the key concepts covered in this course
  • install Mocha and Sinon on your local machine
  • create an object to be used in test cases
  • use fakes to record function invocations
  • configure fakes with specific behavior
  • test the order of function invocations using fakes
  • recognize how to test errors and callbacks with fakes
  • perform asynchronous tests using fakes with promises
  • create and use anonymous spies for testing
  • wrap spies around existing functions
  • spy on specific methods of an object
  • describe the use of sandboxes for testing
  • perform testing using spies on object getters and setters
  • test real world components using spies
  • configure stub behavior in test cases
  • create stubs for object methods
  • instantiate objects without invoking object constructors
  • perform testing using mocks and set expectations
  • use spy calls to test function invocations
  • control time in tests to make asynchronous testing easy
  • use fake timers with multiple async functions
  • use sandboxes to simplify testing
  • summarize the key concepts covered in this course

Overview/Description

This course explores the use of fakes, spies, stubs, and mocks in Sinon and also the use of fake timers and sandboxes to write unit tests. You will configure fakes and spies with behavior, you will set up the right expectations for your mocks and you will control time using fake timers for asynchronous operations which use promises in JavaScript.



Target

Prerequisites: none

Close Chat Live